home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
me_cd25.zip
/
ME2MUTT.ZIP
/
SWITCHB.MUT
< prev
next >
Wrap
Text File
|
1992-11-09
|
829b
|
32 lines
;; switchb.mut : a new switch-to-buffer that remembers the last switched
;; to buffer so you can use that as a default.
;; C Durland Public Domain
(include me2.h)
(int last-selected-buffer)
(defun
switch-buffer
{
(int n)
(string name)
(if (== "" ;; response of "" means use default
(name (complete CC_BUF
(concat "Use buffer ["
(buffer-name last-selected-buffer) "]: "))))
{ ;; default: toggle between current and old buffer
(n last-selected-buffer)
(last-selected-buffer (current-buffer))
(current-buffer n)
}
{ ;; switch to a new buffer, remember old one
(last-selected-buffer (current-buffer))
;;??????????? (switch-to-buffer name)
(current-buffer (create-buffer name))
})
}
MAIN { (last-selected-buffer 0) }
)